/** * Created by zzg on 15-12-25. */ object HBaseTest { def main(args: Array[String]): Unit = {
try{ val connection = ConnectionFactory.createConnection(hBaseConf)
val table = connection.getTable(TableName.valueOf("test")) val scan = new Scan() val resultScanner = table.getScanner(scan) var res = resultScanner.next() while(res!=null){ val rowBytes = res.getRow val key = Bytes.toString(rowBytes) println("ok") println(key) res = resultScanner.next() } }catch { case a: Exception=> a.printStackTrace() }